package com.example.service.impl;

import com.example.mapper.AdministerMapper;
import com.example.pojo.Administer;
import com.example.service.AdministerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

/**
 * 名称AdministerServiceImpl
 * 描述Service的具体实现
 *
 * @version 1.0
 * @author:wanghao
 * @datatime:2023,04,16,14,28
 */
@Service
@Primary
public class AdministerServiceImpl implements AdministerService {
    @Autowired
    AdministerMapper administerMapper;

    //登陆对密码检测的业务逻辑实现
    @Override
    public  String CheckAdminPasswd(String name,String passwd)
    {
        Administer administer = administerMapper.CheckAdminLogin(name);
        if(administer!=null)
            if (administer.getPasswd().equals(passwd)){
                return "true";
            }
            else {return "false";}
        else return "not exist";
    }

    @Override
    public Integer InsertAdminister(Administer administer)
    {
        return administerMapper.InsertAdminister(administer);
    }

}
